<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.wxtf.platform.plugins.user.*"%>
<%@page import="com.wxtf.platform.main.employee.EmployeeAction"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
	UserBean user = (UserBean)request.getSession().getAttribute("userBean");
	
	String _db = user.getDbType();
	Map<String,List<Map<String, String>>> dicMap = user.getDicMap();
	List<Map<String, String>> list = null;
	String temp = "";
	
	String tbe_employment_forms = "";//用工形式
	String tbe_nation = "";//民族
	String tbe_marital_status = "";//婚姻状态
	String tbe_marital_condition = "";//婚姻状况
	String tbe_qualification = "";//学历
	String tbe_status = "";//员工状态
	String tbe_ba_status = "";//生育能力状态
	String tbe_birth_control_measures = "";//节育措施
	String tbe_es_reason="";//重点理由
	String tbcsr_type="";//手术类型
	
	
	list = dicMap.get("101");
	if(null != list && list.size() > 0){
		for(Map<String, String> map: list){
			tbe_employment_forms += "<option value=\"" + map.get("tmgd_id")+"\">" + map.get("tmgd_name") + "</option>";
		}
	}
	list = null;
	list = dicMap.get("5");
	if(null != list && list.size() > 0){
		for(Map<String, String> map: list){
			tbe_nation += "<option value=\"" + map.get("tmgd_id")+"\">" + map.get("tmgd_name") + "</option>";
		}
	}
	list = null;
	list = dicMap.get("27");
	if(null != list && list.size() > 0){
		for(Map<String, String> map: list){
			tbe_marital_status += "<option value=\"" + map.get("tmgd_id")+"\">" + map.get("tmgd_name") + "</option>";
		}
	}
	list = null;
	list = dicMap.get("7");
	if(null != list && list.size() > 0){
		for(Map<String, String> map: list){
			tbe_marital_condition += "<option value=\"" + map.get("tmgd_id")+"\">" + map.get("tmgd_name") + "</option>";
		}
	}
	list = null;
	list = dicMap.get("8");
	if(null != list && list.size() > 0){
		for(Map<String, String> map: list){
			tbe_qualification += "<option value=\"" + map.get("tmgd_id")+"\">" + map.get("tmgd_name") + "</option>";
		}
	}
	list = null;
	list = dicMap.get("102");
	if(null != list && list.size() > 0){
		for(Map<String, String> map: list){
			tbe_status += "<option value=\"" + map.get("tmgd_id")+"\">" + map.get("tmgd_name") + "</option>";
		}
	}
	list = null;
	list = dicMap.get("103");
	if(null != list && list.size() > 0){
		for(Map<String, String> map: list){
			tbe_ba_status += "<option value=\"" + map.get("tmgd_id")+"\">" + map.get("tmgd_name") + "</option>";
		}
	}
	list = null;
	list = dicMap.get("104");
	if(null != list && list.size() > 0){
		for(Map<String, String> map: list){
			tbe_birth_control_measures += "<option value=\"" + map.get("tmgd_id")+"\">" + map.get("tmgd_name") + "</option>";
		}
	}
	list = null;
	list = dicMap.get("107");
	if(null != list && list.size() > 0){
		for(Map<String, String> map: list){
			tbe_es_reason += "<option value=\"" + map.get("tmgd_id")+"\">" + map.get("tmgd_name") + "</option>";
		}
	}
	list = null;
	list = dicMap.get("109");
	if(null != list && list.size() > 0){
		for(Map<String, String> map: list){
			tbcsr_type += "<option value=\"" + map.get("tmgd_id")+"\">" + map.get("tmgd_name") + "</option>";
		}
	}
	
	
	String tmad_name="";//药具名称
	Map<String,List<Map<String, String>>> dicMap_yj =  EmployeeAction.selectTmaDictionary();
	List<Map<String, String>> list_yj = null;
	list_yj = dicMap_yj.get("yaoju_name");
	if(null != list_yj && list_yj.size() > 0){
		for(Map<String, String> map_1: list_yj){
			tmad_name += "<option value=\"" + map_1.get("tmad_id")+"\">" + map_1.get("tmad_name") + "</option>";
		}
	}
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<base href="<%=basePath%>"/>
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta http-equiv="pragma" content="no-cache"/>
		<meta http-equiv="cache-control" content="no-cache"/>
		<meta http-equiv="expires" content="0"/>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

		<link type="text/css" rel="stylesheet" href="ligerUI/skins/Aqua/css/ligerui-all.css" />
		<link type="text/css" rel="stylesheet" href="ligerUI/skins/<%=user.getUserCss()%>/css/ligerui-all.css" />
		<link type="text/css" rel="stylesheet" href="ligerUI/skins/ligerui-icons.css" />
		<link type="text/css" rel="stylesheet" href="resource/css/style.css" />

		<script type="text/javascript" src="js/jquery/jquery-1.7.2.js"></script>
		<script type="text/javascript" src="ligerUI/js/core/base.js"></script>
		<script type="text/javascript" src="ligerUI/js/ligerui.min.js"></script>
		<script type="text/javascript" src="js/common.js"></script>

		<script type="text/javascript" src="ligerUI/js/plugins/ligerGrid.js"></script>
		
		
<script type="text/javascript">
var _db = '<%=_db%>';

_jsonObj.classname = "com.wxtf.platform.main.employee.EmployeeAction";
_jsonObj.methodname = "select_employQuery";
_jsonObj.logicdata = "[{\"types\":\"init\"}]";


var win;//人员新建/修改弹出框
var win2;//高级检索弹出框
var manager;//人员表格
var arraySerarchList = new Array();//高级搜索条件数组

$(function(){
	manager = $("#emp-grid").ligerGrid({
		url: _url, parms: _jsonObj, width: '100%', height: '100%',
		usePager: true, rownumbers: true, checkbox: false, alternatingRow: true,
		columns: [
			{ display: 'tbe_id', name: 'tbe_id', hide: true,width:1 },
			{ display: 'org_id', name: 'org_id', hide: true,width:1 },
			{ display: '机构名称', name: 'reserve1', width:150 },
			{ display: '姓名', name: 'tbe_name', width: 100 ,render: function(record, index, value, oth){
					return " <a href='javascript:viewData(" + JSON.stringify(record) + ")'>" + value + "</a>";
				}
			},
			{ display: '性别', name: 'tbe_sex', width: 60, align: 'center' },
			{ display: '年龄', name: 'tbe_age', width: 1,hide:true },
			{ display: '出生日期', name: 'tbe_birthday', width: 100, align: 'center' },
			{ display: '身份证号', name: 'tbe_idcard', width: 180, align: 'left' },
			{ display: '职工证号', name: 'tbe_work_permit', width: 1, hide: true },
			{ display: '民族', name: 'tbe_nation', width:  1, hide: true},
			{ display: '用工形式', name: 'tbe_employment_forms', width:1, hide: true },
			{ display: '曾用名', name: 'tbe_former_name', hide: true,width:1},
			{ display: '拼音码', name: 'tbe_spell_code', hide: true,width:1},
			{ display: '出生地', name: 'tbe_birthplace',hide: true,width:1},
			{ display: '入厂时间', name: 'tbe_join_time', width:  1, hide:true },
			{ display: '工龄', name: 'tbe_seniority', width:  1, hide:true },
			{ display: '手机', name: 'tbe_mobile', width: 1, hide:true },
			{ display: '家庭住址', name: 'tbe_address', width: 1, hide: true },
			{ display: '家庭电话', name: 'tbe_family_phone', width: 1, hide: true },
			{ display: '籍贯', name: 'tbe_native_palce', width: 1, hide: true },
			{ display: '婚姻状态', name: 'tbe_marital_status', width: 80,
			       render: function(record, index, value, oth){
						 <%
						list = dicMap.get("27");
						temp = "";
						if(null != list && list.size() > 0){
							for(Map<String, String> map: list){
						%>
						if(value == '<%=map.get("tmgd_id")%>'){
							<%
							temp = map.get("tmgd_name");
							%>
							return '<%=temp%>';
						}
						<%
							}
						}
						%>
						 return value;
					}
			 },
			 
			 { display: '配偶姓名', name: 'tbfi_spouse_name', width: 100	},
			 { display: '配偶性别', name: 'tbfi_spouse_sex', width: 80},
			 { display: '配偶出生日期', name: 'tbfi_spouse_birthday', width: 100	},
			 { display: '配偶身份证号', name: 'tbfi_spouse_idcard', width: 100	},
		     { display: '配偶所属单位', name: 'tbfi_spouse_department', width: 100	},
		     { display: '家庭子女数', name: 'tbfi_children_num', width: 100	},
     	     { display: '男孩数', name: 'tbfi_children_mnum', width: 60	},
     	     { display: '女孩数', name: 'tbfi_children_fnum', width: 60	},
		     
			{ display: '婚姻状况', name: 'tbe_marital_condition', width: 1, hide:true	},
			{ display: '结婚时间', name: 'tbe_married_time', width:  1, hide:true },
			{ display: '结婚证号', name: 'tbe_marriage_certificate', width:  1, hide:true },
			{ display: '政治面貌', name: 'tbe_political_status', width:  1, hide:true },
			{ display: '学历', name: 'tbe_qualification', width:  1, hide:true },
			{ display: '毕业学校', name: 'tbe_graduate_college', width:  1, hide:true },
			{ display: '所学专业', name: 'tbe_major', width:  1, hide:true },
			{ display: '工作时间', name: 'tbe_work_area', width:  1, hide:true },
			{ display: '职务', name: 'tbe_position', width:  1, hide:true },
			{ display: '是否允许再生育', name: 'tbe_is_again_birth', width:  1, hide:true },
			{ display: '是否不孕症', name: 'tbe_is_barrenness', width:  1, hide:true },
			{ display: '是否绝经', name: 'the_is_menopause', width:  1, hide:true },
			{ display: '是否晚婚', name: 'tbe_is_late_marriage', width:  1, hide:true },
			{ display: '是否晚育', name: 'tbe_is_late_birth', width:  1, hide:true },
			{ display: '员工状态', name: 'tbe_status', width:  1, hide:true },
			{ display: '生育能力状态', name: 'tbe_ba_status', width:  1, hide:true },
			{ display: '节育措施', name: 'tbe_birth_control_measures', width:  1, hide:true },
			{ display: '设为重点时间', name: 'tbe_es_time', width:  1, hide:true },
			{ display: '是否重点服务对象', name: 'tbe_is_es', width:  1, hide:true },
			{ display: '重点理由', name: 'tbe_es_reason', width:  1, hide:true },
			{ display: '子女情况', name: 'tbe_children_status', width:  1, hide:true },
			{ display: '排序号', name: 'tbe_order', width:  1, hide:true },
			{ display: '备注', name: 'tbe_memo', width:  1, hide:true },
			{ display: 'reserve2', name: 'reserve2', width:  1, hide:true },
			{ display: 'reserve3', name: 'reserve3', width:  1, hide:true },
			{ display: 'reserve4', name: 'reserve4', width:  1, hide:true },
			{ display: 'reserve5', name: 'reserve5', width:  1, hide:true },
			{ display: '录入人', name: 'create_by', width:  1, hide:true },
			{ display: '录入时间', name: 'create_time', width:  1, hide:true },
			{ display: '最后修改人', name: 'last_modify_by', width:  1, hide:true },
			{ display: '最后修改时间', name: 'last_modify_time', width: 1, hide:true }
		]
	});
	
	
});

/*
 * 表格刷新
 */
function reload(){
	_jsonObj.methodname = "select_employQuery";
	_jsonObj.logicdata = "[{\"types\":\"init\"}]";
	manager.loadData();
}

/*
 * ajax成功回调
 */
function ajaxCallbackSuccFunc(data, textStatus){
	if(win){
		win.hide();
	}
	succMsgTip(data.resultrecord);
	reload();
}

/*
 * ajax失败回调
 */
function ajaxCallbackErrorFunc(data, textStatus){
	warningTip(data.resultrecord);
}

/*
 * 查看员工综合查询
 */

var h1 = '<tr><th>类别</th><th>姓名（员工）</th><th>身份证号（员工）</th><th>工作单位（员工）</th><th>姓名（配偶）</th><th>身份证号（配偶）</th><th>工作单位（配偶）</th><th>结婚时间</th><th>结婚证号</th><th>生育指标批准起始时间</th><th>生育指标批准截止时间</th></tr>';
var h2 = '<tr><th>独生子女姓名</th><th>独生子女性别</th><th>独生子女年龄</th><th>独生子女出生日期</th><th>独生子女身份证号</th><th>证件编号</th><th>办证时间</th><th>奖励发放时间</th><th>费用核算参数</th></tr>';
var h3 = '<tr><th>怀孕登记状态</th><th>怀孕时间</th></tr>';
var h4 = '<tr><th>计划状态登记项</th><th>出生时间</th></tr>';
var h5 = '<tr><th>手术类型</th><th>手术地点</th><th>手术医院</th><th>主治医生</th><th>手术时间</th></tr>';
var h6 = '<tr><th>发放编号</th><th>发放形式</th><th>发放人</th><th>发放时间</th><th>药具数量</th><th>药具种类</th><th>药品名称</th><th>药品规格</th><th>剂型</th><th>批号(药品编码)</th></tr>';
var h7 = '<tr><th>随访日期</th><th>当前用药</th><th>使用时间</th><th>开始使用时间</th><th>用药效果</th><th>同时用药</th><th>副反应（代码）</th><th>情况处理</th><th>登记者</th></tr>';
var h8 = '<tr><th>随访时间</th><th>随访人</th><th>随访内容</th></tr>';

function viewData(row){
	for(var i=0;i<=11;i++){
		var f = 'form' + i;
		document.getElementById(f).reset();
	}
	
	
	
	//loadForm("form0", row);
	if(win == null){
		win = initWindowByDiv2('emp-div', '员工综合查询', 1100, 480, closeWin);
	} else {
		win.show();
	}
	
	$("#tab-div").ligerTab({
		dblClickToClose: false
	});
	
	$('#tbe_work_permit').html(row.tbe_work_permit);
	$('#tbe_name').html(row.tbe_name);
	$('#tbe_sex').html(row.tbe_sex);
	$('#tbe_nation').html(getDicNameById1(row.tbe_nation));
	$('#tbe_idcard').html(row.tbe_idcard);
	$('#tbe_birthday').html(row.tbe_birthday);
	$('#tbe_native_palce').html(row.tbe_native_palce);
	$('#tbe_address').html(row.tbe_address);
	$('#tbe_family_phone').html(row.tbe_family_phone);
	$('#tbe_work_area').html(row.tbe_work_area);
	$('#tbe_graduate_college').html(row.tbe_graduate_college);
	$('#tbe_major').html(row.tbe_major);
	$('#tbe_qualification').html(getDicNameById5(row.tbe_qualification));
	$('#reserve1').html(row.reserve1);
	$('#tbe_employment_forms').html(getDicNameById2(row.tbe_employment_forms));
	$('#tbe_position').html(getDicNameById_zhiji(row.tbe_position));
	$('#tbe_status').html(getDicNameById6(row.tbe_status));
	$('#tbe_join_time').html(row.tbe_join_time);
	$('#tbe_marital_status').html(getDicNameById3(row.tbe_marital_status));
	$('#tbe_marital_condition').html(getDicNameById4(row.tbe_marital_condition));
	$('#tbe_married_time').html(row.tbe_married_time);
	$('#tbe_marriage_certificate').html(row.tbe_marriage_certificate);
	$('#tbe_is_late_marriage').html(row.tbe_is_late_marriage  == '1'?'是':'否');
	
	
	
	
	_jsonObj.methodname = "query1";
	_jsonObj.logicdata = '[{\"tbe_id\":\"' + row.tbe_id + '\"}]';
	callserver(_jsonObj, function(data, textStatus){
		//family,birth,rewardpunishment,motherhood,contraception,contraceptive,visit
		var jsons = data[0];
		var family = jsons.family;//配偶
		
		$('#tbfi_spouse_is_join').html(family[0].tbfi_spouse_is_join == '1'?'是':'否');
		$('#tbfi_spouse_name').html(family[0].tbfi_spouse_name);
		$('#tbfi_spouse_sex').html(family[0].tbfi_spouse_sex);
		$('#tbfi_spouse_birthday').html(family[0].tbfi_spouse_birthday);
		$('#tbfi_spouse_idcard').html(family[0].tbfi_spouse_idcard);
		$('#tbfi_spouse_department').html(family[0].tbfi_spouse_department);
		$('#tbfi_spouse_position').html(getDicNameById_zhiji(family[0].tbfi_spouse_position));
		
		$('#tbfi_children_num').html(family[0].tbfi_children_num);
		$('#tbfi_children_mnum').html(family[0].tbfi_children_mnum);
		$('#tbfi_children_fnum').html(family[0].tbfi_children_fnum);
		
		var birth = jsons.birth;//一胎/再生
		var onlyChild = jsons.onlyChild;//独生子女
		var html = '';
		for(var i=0; i<birth.length; i++){
			html += '<tr>';
			html += '<td>' + getDicNameById_zm_type(birth[i].tbefbr_type) + '</td>';
			html += '<td>' + birth[i].tbefbr_mname + '</td>';
			html += '<td>' + birth[i].tbefbr_midcard + '</td>';
			html += '<td>' + birth[i].tbefbr_mdepartment + '</td>';
			html += '<td>' + birth[i].tbefbr_fname + '</td>';
			html += '<td>' + birth[i].tbefbr_fidcard + '</td>';
			html += '<td>' + birth[i].tbefbr_fdepartment + '</td>';
			html += '<td>' + birth[i].tbefbr_married_time + '</td>';
			html += '<td>' + birth[i].tbefbr_marriage_certificate + '</td>';
			html += '<td>' + birth[i].tbefbr_agree_birth_btime + '</td>';
			html += '<td>' + birth[i].tbefbr_agree_birth_etime + '</td>';
			html += '</tr>';
		}
		$('#birth-table').html(h1 + html);
		
		if(onlyChild.length > 0){
			html = '<tr>';
			html += '<td>' + onlyChild[0].tbeocr_child_name + '</td>';
			html += '<td>' + (onlyChild[0].tbeocr_child_sex=="0"?"男":"女") + '</td>';
			html += '<td>' + onlyChild[0].tbeocr_child_age + '</td>';
			html += '<td>' + onlyChild[0].tbeocr_child_birthday + '</td>';
			html += '<td>' + onlyChild[0].tbeocr_child_idcard + '</td>';
			html += '<td>' + onlyChild[0].tbeocr_code + '</td>';
			html += '<td>' + onlyChild[0].tbeocr_time + '</td>';
			html += '<td>' + onlyChild[0].tbeocr_give_time + '</td>';
			html += '<td>' + onlyChild[0].tbeocr_fee_param + '</td>';
			html += '</tr>';
			$('#onlyChild-table').html(h2 + html);
		}
		if(onlyChild.length == 0)
		{
			$('#onlyChild-table').html(h2);
		}
		
		var rewardpunishment = jsons.rewardpunishment;//奖罚
		$('#onlyChildFee').html(rewardpunishment[0].onlyChildFee);
		$('#rewardFee').html(rewardpunishment[0].rewardFee);
		$('#exceedsFee').html(rewardpunishment[0].exceedsFee);
		
		var motherhood = jsons.motherhood;//孕产史
		$('#tbe_is_late_birth').html(row.tbe_is_late_birth == '1'?'是':'否');
		
		html = '';
		var baby = motherhood[0].baby;
		for(var i=0; i<baby.length; i++){
			html += '<tr>';
			html += '<td>' + getType1(baby[i].tbepr_option) + '</td>';
			html += '<td>' + baby[i].tbepr_ptime + '</td>';
			html += '</tr>';
		}
		$('#pregnancy-table').html(h3 + html);
		
		html = '';
		var newBaby = motherhood[0].newBaby;
		for(var i=0; i<newBaby.length; i++){
			html += '<tr>';
			html += '<td>' + getType2(newBaby[i].tbenm_plan_status) + '</td>';
			html += '<td>' + newBaby[i].tbenm_birth_time + '</td>';
			html += '</tr>';
		}
		$('#neonate-table').html(h4 + html);
		
		var contraception = jsons.contraception;//避孕史
		$('#tbe_birth_control_measures').html(getDicNameById8(row.tbe_birth_control_measures));
		html = '';
		for(var i=0; i<contraception.length; i++){
			html += '<tr>';
			html += '<td>' + contraception[i].tbcsr_type + '</td>';
			html += '<td>' + contraception[i].tbcsr_place + '</td>';
			html += '<td>' + contraception[i].tbcsr_hospital + '</td>';
			html += '<td>' + contraception[i].tbcsr_doctor + '</td>';
			html += '<td>' + contraception[i].tbcsr_time + '</td>';
			html += '</tr>';
		}
		$('#contraception-table').html(h5 + html);
		
		var contraceptive = jsons.contraceptive;//药具使用
		$('#tbe_birth_control_measures').html(getDicNameById8(row.tbe_birth_control_measures));
		html = '';
		for(var i=0; i<contraceptive.length; i++){
			html += '<tr>';
			html += '<td>' + contraceptive[i].tmapm_code + '</td>';
			html += '<td>' + (contraceptive[i].tmapm_style=='0'?"发放":"领用") + '</td>';
			html += '<td>' + contraceptive[i].tmapm_person + '</td>';
			html += '<td>' + contraceptive[i].tmapm_time + '</td>';
			html += '<td>' + contraceptive[i].tmapd_num + '</td>';
			html += '<td>' + getDicNameById10(contraceptive[i].tmad_kind) + '</td>';
			html += '<td>' + contraceptive[i].tmad_name + '</td>';
			html += '<td>' + contraceptive[i].tmad_spec + '</td>';
			html += '<td>' + contraceptive[i].tmad_formulation + '</td>';
			html += '<td>' + contraceptive[i].tmad_batch_code + '</td>';
			html += '</tr>';
		}
		$('#contraceptive-table').html(h6 + html);

		var visit = jsons.visit;//随访
		var yaojusuifang = visit[0].yaojusuifang;
		html = '';
		for(var i=0; i<yaojusuifang.length; i++){
			html += '<tr>';
			html += '<td>' + yaojusuifang[i].tmamvd_time + '</td>';
			html += '<td>' + getDicNameById_yjname(yaojusuifang[i].tmamvm_cmedicine_des )+ '</td>';
			html += '<td>' + yaojusuifang[i].tmamvm_lmedicine_time + '</td>';
			html += '<td>' + yaojusuifang[i].tmad_begin_time + '</td>';
			html += '<td>' + yaojusuifang[i].tmamvd_pharmacy_effect + '</td>';
			html += '<td>' + getDicNameById_same_pharmacy_des(yaojusuifang[i].tmamvd_same_pharmacy_des) + '</td>';
			html += '<td>' + getDicNameById11(yaojusuifang[i].tmamvd_side_effect_code )+ '</td>';
			html += '<td>' + yaojusuifang[i].tmamvd_treament + '</td>';
			html += '<td>' + yaojusuifang[i].create_by + '</td>';
			html += '</tr>';
		}
		$('#yaojusuifang-table').html(h7 + html);
		
		var keySerObj = visit[0].keySerObj;
		html = '';
		for(var i=0; i<keySerObj.length; i++){
			html += '<tr>';
			html += '<td>' + keySerObj[i].tesvr_time + '</td>';
			html += '<td>' + keySerObj[i].tesvr_vistor + '</td>';
			html += '<td>' + keySerObj[i].tesvr_description + '</td>';
			html += '</tr>';
		}
		$('#keySerObj-table').html(h8 + html);
		
		
		
		
	}, ajaxCallbackErrorFunc);
}

function getType1(key){
	if(key == '0'){
		return "怀孕";
	} else if(key == '1'){
		return "等孕";
	} else if(key == '2'){
		return "无";
	} else {
		return "";
	}
}
function getType2(key){
	if(key == '0'){
		return "计划内一胎";
	} else if(key == '1'){
		return "计划内二胎";
	} else {
		return "";
	}
}

//民族
function getDicNameById1(id){
	<%
	list = dicMap.get("5");
	temp = "";
	if(null != list && list.size() > 0){
		for(Map<String, String> map: list){
	%>
	if(id == '<%=map.get("tmgd_id")%>'){
		<%temp = map.get("tmgd_name");%>
		return '<%=temp%>';
	}
	<%}}%>
	return id;
}
//用工形式
function getDicNameById2(id){
	<%
	list = dicMap.get("101");
	temp = "";
	if(null != list && list.size() > 0){
		for(Map<String, String> map: list){
	%>
	if(id == '<%=map.get("tmgd_id")%>'){
		<%temp = map.get("tmgd_name");%>
		return '<%=temp%>';
	}
	<%}}%>
	return id;
}
//婚姻状态
function getDicNameById3(id){
	<%
	list = dicMap.get("27");
	temp = "";
	if(null != list && list.size() > 0){
		for(Map<String, String> map: list){
	%>
	if(id == '<%=map.get("tmgd_id")%>'){
		<%temp = map.get("tmgd_name");%>
		return '<%=temp%>';
	}
	<%}}%>
	return id;
}
//婚姻状况
function getDicNameById4(id){
	<%
	list = dicMap.get("7");
	temp = "";
	if(null != list && list.size() > 0){
		for(Map<String, String> map: list){
	%>
	if(id == '<%=map.get("tmgd_id")%>'){
		<%temp = map.get("tmgd_name");%>
		return '<%=temp%>';
	}
	<%}}%>
	return id;
}
//学历
function getDicNameById5(id){
	<%
	list = dicMap.get("8");
	temp = "";
	if(null != list && list.size() > 0){
		for(Map<String, String> map: list){
	%>
	if(id == '<%=map.get("tmgd_id")%>'){
		<%temp = map.get("tmgd_name");%>
		return '<%=temp%>';
	}
	<%}}%>
	return id;
}
//员工状态
function getDicNameById6(id){
	<%
	list = dicMap.get("102");
	temp = "";
	if(null != list && list.size() > 0){
		for(Map<String, String> map: list){
	%>
	if(id == '<%=map.get("tmgd_id")%>'){
		<%temp = map.get("tmgd_name");%>
		return '<%=temp%>';
	}
	<%}}%>
	return id;
}
//生育能力状态
function getDicNameById7(id){
	<%
	list = dicMap.get("103");
	temp = "";
	if(null != list && list.size() > 0){
		for(Map<String, String> map: list){
	%>
	if(id == '<%=map.get("tmgd_id")%>'){
		<%temp = map.get("tmgd_name");%>
		return '<%=temp%>';
	}
	<%}}%>
	return id;
}
//节育措施
function getDicNameById8(id){
	<%
	list = dicMap.get("104");
	temp = "";
	if(null != list && list.size() > 0){
		for(Map<String, String> map: list){
	%>
	if(id == '<%=map.get("tmgd_id")%>'){
		<%temp = map.get("tmgd_name");%>
		return '<%=temp%>';
	}
	<%}}%>
	return id;
}
//重点理由
function getDicNameById9(id){
	<%
	list = dicMap.get("107");
	temp = "";
	if(null != list && list.size() > 0){
		for(Map<String, String> map: list){
	%>
	if(id == '<%=map.get("tmgd_id")%>'){
		<%temp = map.get("tmgd_name");%>
		return '<%=temp%>';
	}
	<%}}%>
	return id;
}
//药品分类
function getDicNameById10(id){
	<%
	list = dicMap.get("105");
	temp = "";
	if(null != list && list.size() > 0){
		for(Map<String, String> map: list){
	%>
	if(id == '<%=map.get("tmgd_id")%>'){
		<%temp = map.get("tmgd_name");%>
		return '<%=temp%>';
	}
	<%}}%>
	return id;
}
//副反应
function getDicNameById11(id){
	<%
	list = dicMap.get("201");
	temp = "";
	if(null != list && list.size() > 0){
		for(Map<String, String> map: list){
	%>
	if(id == '<%=map.get("tmgd_id")%>'){
		<%temp = map.get("tmgd_name");%>
		return '<%=temp%>';
	}
	<%}}%>
	return id;
}

//药具名
function getDicNameById_yjname(id){
	<%
	Map<String,List<Map<String, String>>> dicMap_yjname =  EmployeeAction.selectTmaDictionary();
	List<Map<String, String>> list_yjname = null;
	list_yjname = dicMap_yjname.get("yaoju_name");
	temp = "";
	if(null != list_yjname && list_yjname.size() > 0){
		for(Map<String, String> map_yjname: list_yjname){
	%>
	if(id == '<%=map_yjname.get("tmad_id")%>'){
		<%temp = map_yjname.get("tmad_name");%>
		return '<%=temp%>';
	}
	<%}}%>
	return id;
}

//同时用药
function getDicNameById_same_pharmacy_des(id){
 return  id=="0"?"否":"是";
}
//职级
function getDicNameById_zhiji(id){
 if(id=='1') {return "专业技术管理";}
 else if(id=='2') {return "生产操作服务";}
}
//类别--一胎/再生育证明
function getDicNameById_zm_type(id){
 if(id=='0') {return "一胎生育证明";}
 else if(id=='1') {return "再生育证明";}
}
//核算参数--独生子女
function getDicNameById_canshu(id){
 if(id=='0') {return "5元";}
 else if(id=='1') {return "10元";}
 else if(id=='2') {return "无";}
}

/*
 * 条件查询
 */
function serch1(){
	var orgIds = $('#ser0').val();
	var tbe_employment_forms = $('#ser5').val();
	var tbe_name = $('#ser1').val();
	var tbe_idcard = $('#ser4').val();
	
	_jsonObj.methodname = "select_employQuery";
	_jsonObj.logicdata = '[{\"orgIds\":\"' + orgIds + '\",\"tbe_spell_code\":\"\",\"tbe_employment_forms\":\"'
		+ tbe_employment_forms + '\",\"tbe_name\":\"' + tbe_name + '\",\"tbe_idcard\":\"' + tbe_idcard + '\",\"types\":\"serch1\"}]';
	manager.loadData();
}

/*
 * 高级查询
 */
function serch2(){
	if(win2 == null){
		win2 = initWindowByDiv('tallSearch','高级查询', 800, 454, function(){
			var tableName = "";
        	var objArrayOne = $("[name=luojiOne]");
        	var objArrayTwo = $("[name=luojiTwo]");
        	var arrayColsName = $("[name=colsName]");
        	var arrayColsValue = $("[name=colsValue]");
        	
        	var tempSearch = "";
        	for(var i=0; i<arrayColsName.length; i++){
        		var conditionValue = objArrayOne[i+1].value;
        		if(conditionValue == "like"){
		        	arraySerarchList.push(" " + objArrayTwo[i+1].value+" "+tableName+arrayColsName[i].value+" "+objArrayOne[i+1].value+" '%"+arrayColsValue[i].value+"%' ");
        		}else if(conditionValue == "in"){
        			var strArr = arrayColsValue[i].value.split(",");
        			var tempStr = "";
        			for(var j=0; j<strArr.length; j++){
        				tempStr +="'"+strArr[j]+"',";
        			}
		        	arraySerarchList.push(" " + objArrayTwo[i+1].value+" "+tableName+arrayColsName[i].value+" "+objArrayOne[i+1].value+" ("+tempStr.substring(0,tempStr.length-1)+") ");
        		}else if(conditionValue == "between"){
        			var strArr = arrayColsValue[i].value.split(",");
		        	arraySerarchList.push(" " + objArrayTwo[i+1].value+" "+tableName+arrayColsName[i].value+" "+objArrayOne[i+1].value+" '"+strArr[0]+"' and '"+strArr[1]+"' ");
        		}else if(conditionValue == "is null"){
		        	arraySerarchList.push(" " + objArrayTwo[i+1].value+" "+tableName+arrayColsName[i].value+" "+objArrayOne[i+1].value+" ");
        		}else{
		        	arraySerarchList.push(" " + objArrayTwo[i+1].value+" "+tableName+arrayColsName[i].value+" "+objArrayOne[i+1].value+" '"+arrayColsValue[i].value+"' ");
        		}
        	}
        	
        	var whereAnd = "";
        	for(var i=0;i<arraySerarchList.length;i++){
        		whereAnd += arraySerarchList[i];
        	}
        	
        	_jsonObj.methodname = "gaoji_ser";
			_jsonObj.logicdata = '[{\"where\":\"' + whereAnd + '\",\"types\":\"serch2\"}]';
			manager.loadData();
        	
        	arraySerarchList.length = 0;
        	win2.hide();
        	
		},closeWin);
	}else{
		win2.show();
	}
}

/*
 * 动态给table添加一个tr-高级查询
 */
function tallSearchCols(clValue){
	var clName = $("option[value='" + clValue + "']").eq(0).text()
	if(clValue=="tbe_birthday" || clValue=="tbe_join_time" || clValue=="tbe_married_time"|| clValue=="tbe_work_area" || clValue=="tbe_es_time" || clValue=="tbepr_ptime" || clValue=="tbcsr_time" || clValue=="tmapm_time"  || clValue=="tmaam_time"      ){   //时间
		$("#appendTable").append('<tr style="height:26px;"><td width="60px"><input name="colsName"  type="hidden" value="'+clValue+'">'+clName+'</td><td width="120px">'+$("#condition").html()+'</td><td width="150px"><input name="colsValue" class="times" type="text" onkeyup="this.value=formatdata(this.value);" /></td><td width="90px">'+$("#conditionAnd").html()+'</td><td width="60px" style="cursor: pointer;" onClick="getDel(this)">删除</td></tr>');
		$(".times").ligerDateEditor({width :120});
	}else if(clValue=="tbe_is_es" || clValue=="tbe_is_barrenness" || clValue=="the_is_menopause" || clValue=="tbe_is_again_birth" || clValue=="tbe_is_late_birth" || clValue=="tbe_is_late_marriage"){
		$("#appendTable").append('<tr style="height:26px;"><td width="60px"><input name="colsName"  type="hidden" value="'+clValue+'">'+clName+'</td><td width="120px">'+$("#condition").html()+'</td><td width="150px"><select name="colsValue" type="text" style="width:120px"><option value="1">是</option><option value="0">否</option></select></td><td>'+$("#conditionAnd").html()+'</td><td style="cursor: pointer;" width="60px" onClick="getDel(this)">删除</td></tr>');
	}else if(clValue=="tbe_sex"){
		$("#appendTable").append('<tr style="height:26px;"><td width="60px"><input name="colsName"  type="hidden" value="'+clValue+'">'+clName+'</td><td width="120px">'+$("#condition").html()+'</td><td width="150px"><select name="colsValue" type="text" style="width:120px"><option value="男">男</option><option value="女">女</option></select></td><td>'+$("#conditionAnd").html()+'</td><td style="cursor: pointer;" width="60px" onClick="getDel(this)">删除</td></tr>');
	}else if(clValue == 'tbe_employment_forms'){
		$("#appendTable").append('<tr style="height:26px;"><td width="60px"><input name="colsName"  type="hidden" value="'+clValue+'">'+clName+'</td><td width="120px">'+$("#condition").html()+'</td><td width="150px"><select name="colsValue" type="text" style="width:120px"><%=tbe_employment_forms%></select></td><td>'+$("#conditionAnd").html()+'</td><td style="cursor: pointer;" width="60px" onClick="getDel(this)">删除</td></tr>');
	} else if(clValue == 'tbe_nation'){
		$("#appendTable").append('<tr style="height:26px;"><td width="60px"><input name="colsName"  type="hidden" value="'+clValue+'">'+clName+'</td><td width="120px">'+$("#condition").html()+'</td><td width="150px"><select name="colsValue" type="text" style="width:120px"><%=tbe_nation%></select></td><td>'+$("#conditionAnd").html()+'</td><td style="cursor: pointer;" width="60px" onClick="getDel(this)">删除</td></tr>');
	} else if(clValue == 'tbe_marital_status'){
		$("#appendTable").append('<tr style="height:26px;"><td width="60px"><input name="colsName"  type="hidden" value="'+clValue+'">'+clName+'</td><td width="120px">'+$("#condition").html()+'</td><td width="150px"><select name="colsValue" type="text" style="width:120px"><%=tbe_marital_status%></select></td><td>'+$("#conditionAnd").html()+'</td><td style="cursor: pointer;" width="60px" onClick="getDel(this)">删除</td></tr>');
	} else if(clValue == 'tbe_marital_condition'){
		$("#appendTable").append('<tr style="height:26px;"><td width="60px"><input name="colsName"  type="hidden" value="'+clValue+'">'+clName+'</td><td width="120px">'+$("#condition").html()+'</td><td width="150px"><select name="colsValue" type="text" style="width:120px"><%=tbe_marital_condition%></select></td><td>'+$("#conditionAnd").html()+'</td><td style="cursor: pointer;" width="60px" onClick="getDel(this)">删除</td></tr>');
	} else if(clValue == 'tbe_qualification'){
		$("#appendTable").append('<tr style="height:26px;"><td width="60px"><input name="colsName"  type="hidden" value="'+clValue+'">'+clName+'</td><td width="120px">'+$("#condition").html()+'</td><td width="150px"><select name="colsValue" type="text" style="width:120px"><%=tbe_qualification%></select></td><td>'+$("#conditionAnd").html()+'</td><td style="cursor: pointer;" width="60px" onClick="getDel(this)">删除</td></tr>');
	} else if(clValue == 'tbe_status'){
		$("#appendTable").append('<tr style="height:26px;"><td width="60px"><input name="colsName"  type="hidden" value="'+clValue+'">'+clName+'</td><td width="120px">'+$("#condition").html()+'</td><td width="150px"><select name="colsValue" type="text" style="width:120px"><%=tbe_status%></select></td><td>'+$("#conditionAnd").html()+'</td><td style="cursor: pointer;" width="60px" onClick="getDel(this)">删除</td></tr>');
	} else if(clValue == 'tbe_ba_status'){
		$("#appendTable").append('<tr style="height:26px;"><td width="60px"><input name="colsName"  type="hidden" value="'+clValue+'">'+clName+'</td><td width="120px">'+$("#condition").html()+'</td><td width="150px"><select name="colsValue" type="text" style="width:120px"><%=tbe_ba_status%></select></td><td>'+$("#conditionAnd").html()+'</td><td style="cursor: pointer;" width="60px" onClick="getDel(this)">删除</td></tr>');
	} else if(clValue == 'tbe_birth_control_measures'){
		$("#appendTable").append('<tr style="height:26px;"><td width="60px"><input name="colsName"  type="hidden" value="'+clValue+'">'+clName+'</td><td width="120px">'+$("#condition").html()+'</td><td width="150px"><select name="colsValue" type="text" style="width:120px"><%=tbe_birth_control_measures%></select></td><td>'+$("#conditionAnd").html()+'</td><td style="cursor: pointer;" width="60px" onClick="getDel(this)">删除</td></tr>');
	} else if(clValue == 'tbepr_option'){   //怀孕登记状态
		$("#appendTable").append('<tr style="height:26px;"><td width="60px"><input name="colsName"  type="hidden" value="'+clValue+'">'+clName+'</td><td width="120px">'+$("#condition").html()+'</td><td width="150px"><select name="colsValue" type="text" style="width:120px"><option value=""></option><option value="2">无</option><option value="0">怀孕</option><option value="1">等孕</option></select></td><td>'+$("#conditionAnd").html()+'</td><td style="cursor: pointer;" width="60px" onClick="getDel(this)">删除</td></tr>');
	} else if(clValue == 'tbenm_plan_status'){   //计划状态登记项
		$("#appendTable").append('<tr style="height:26px;"><td width="60px"><input name="colsName"  type="hidden" value="'+clValue+'">'+clName+'</td><td width="120px">'+$("#condition").html()+'</td><td width="150px"><select name="colsValue" type="text" style="width:120px"><option value=""></option><option value="0">计划内一胎</option><option value="1">计划内二胎</option></select></td><td>'+$("#conditionAnd").html()+'</td><td style="cursor: pointer;" width="60px" onClick="getDel(this)">删除</td></tr>');
	} else if(clValue == 'tbcsr_type'){  //手术类型
		$("#appendTable").append('<tr style="height:26px;"><td width="60px"><input name="colsName"  type="hidden" value="'+clValue+'">'+clName+'</td><td width="120px">'+$("#condition").html()+'</td><td width="150px"><select name="colsValue" type="text" style="width:120px"><%=tbcsr_type%></select></td><td>'+$("#conditionAnd").html()+'</td><td style="cursor: pointer;" width="60px" onClick="getDel(this)">删除</td></tr>');
	} else if(clValue=="yj_fa_2.tmad_id" || clValue=="yj_sl_2.tmad_id" ){   //发放/领用药具名称
	    $("#appendTable").append('<tr style="height:26px;"><td width="60px"><input name="colsName"  type="hidden" value="'+clValue+'">'+clName+'</td><td width="120px">'+$("#condition").html()+'</td><td width="150px"><select name="colsValue" type="text" style="width:120px"><%=tmad_name%></select></td><td>'+$("#conditionAnd").html()+'</td><td style="cursor: pointer;" width="60px" onClick="getDel(this)">删除</td></tr>');
	}else if(clValue=="e.org_id"  ){   //组织机构
	    $("#appendTable").append('<tr style="height:26px;"><td width="60px"><input name="colsName"  type="hidden" value="'+clValue+'">'+clName+'</td><td width="120px">'+$("#condition").html()+'</td><td width="150px"><select name="colsValue" type="text" style="width:120px"><%=user.getCurSubOrgOptions()%></select></td><td>'+$("#conditionAnd").html()+'</td><td style="cursor: pointer;" width="60px" onClick="getDel(this)">删除</td></tr>');
	}
	else {
		$("#appendTable").append('<tr style="height:26px;"><td width="60px"><input name="colsName"  type="hidden" value="'+clValue+'">'+clName+'</td><td width="120px">'+$("#condition").html()+'</td><td width="150px"><input name="colsValue" type="text" style="width:120px"></td><td width="90px">'+$("#conditionAnd").html()+'</td><td width="60px" style="cursor: pointer;" onClick="getDel(this)">删除</td></tr>');
	}
}

/*
 * 删除条件-高级查询
 */
function getDel(ele){
	$(ele).parent().remove();  
}

function tallSearch_first(val)
{
   var name=val;
   if(name=="org"){
   		delete_second_table();
   		$("#second_table").append('<select id="sel_org" style="height: 356px; width: 120px;" ondblclick="tallSearchCols(this.value);" multiple="multiple"><option value="e.org_id">组织机构</option></select> '); 
	}
   if(name=="renkou"){
   		delete_second_table();
   		$("#second_table").append('<select id="sel_renkou" style="height: 356px; width: 120px;" ondblclick="tallSearchCols(this.value);" multiple="multiple"><option value="tbe_name">姓名</option><option value="tbe_sex">性别</option><option value="tbe_idcard">身份证号</option><option value="tbe_birthday">出生日期</option><option value="tbe_nation">民族</option><option value="tbe_native_palce">籍贯</option><option value="tbe_address">家庭住址</option><option value="tbe_family_phone">家庭电话</option><option value="tbe_graduate_college">毕业学校</option><option value="tbe_qualification">学历</option><option value="tbe_major">所学专业</option><option value="tbe_work_permit">职工证号</option><option value="tbe_position">职务</option><option value="tbe_status">员工状态</option><option value="tbe_employment_forms">用工形式</option><option value="tbe_work_area">工作时间</option><option value="tbe_join_time">入厂时间</option><option value="tbe_marital_status">婚姻状态</option><option value="tbe_married_time">结婚时间</option><option value="tbe_marriage_certificate">结婚证号</option><option value="tbe_is_late_marriage">是否晚婚</option><option value="tbe_is_late_birth">是否晚育</option><option value="tbe_is_again_birth">是否允许再生育</option><option value="tbe_is_barrenness">是否不孕症</option><option value="the_is_menopause">是否绝经</option><option value="tbe_is_es">是否重点服务对象</option><option value="tbe_es_time">设为重点时间</option><option value="tbe_es_reason">重点理由</option><option value="tbe_birth_control_measures">节育措施</option><option value="tbe_children_status">子女情况</option><option value="tbe_memo">备注</option></select>'); 
	}
	if(name=="jisheng"){
	    delete_second_table();
	    $("#second_table").append('<select id="sel_jisheng" style="height: 356px; width: 120px;" ondblclick="tallSearchCols(this.value);" multiple="multiple"><option value="tbepr_option">怀孕登记状态</option><option value="tbepr_ptime">怀孕时间</option><option value="tbenm_plan_status">计划状态登记项</option><option value="tbenm_gravida_times">胎次</option><option value="tbenm_gravida_num">胎数</option></select>');
	}
	if(name=="sishu"){
		delete_second_table();
		 $("#second_table").append('<select id="sel_sishu" style="height: 356px; width: 120px;" ondblclick="tallSearchCols(this.value);" multiple="multiple"><option value="tbcsr_type">手术类型</option><option value="tbcsr_place">手术地点</option><option value="tbcsr_hospital">手术医院</option><option value="tbcsr_doctor">主治医生</option><option value="tbcsr_time">手术时间</option></select>');
	}
	if(name=="yaoju"){
		delete_second_table();
		$("#second_table").append('<select id="sel_yaoju" style="height: 356px; width: 120px;" ondblclick="tallSearchCols(this.value);" multiple="multiple"><option value="yj_fa_2.tmad_id">发放药具名</option><option value="tmapm_time">发放时间</option><option value="yj_sl_2.tmad_id">申领药具名</option><option value="tmaam_time">申领时间</option></select>');
	}
}
//将second_table清空
function delete_second_table(){
	var obj = document.getElementById('second_table');
	obj.innerHTML = '';
}

function serch_reset()
{
   $('#ser5').val('0');
   $('#ser1').val('');
   $('#ser4').val('');
}
</script>
	</head>
	<body>
		<table class="serTable">
			<tr>
				<td>机构：<select id="ser0" style=" width: 164px;"><%=user.getCurSubOrgOptions()%></select></td>
				<td>姓名：<input id="ser1" style=" width: 164px;"/></td>
				<td><input class="btn1" value="重置" type="button" onclick="serch_reset();" /></td>
				<td></td>
			</tr>
			<tr>
				<td>
					用工形式：<select id="ser5" style=" width: 164px;">
						<option value="0">全部</option>
						<%=tbe_employment_forms%>
					</select>
				</td>
				<td>身份证：<input id="ser4" style=" width: 164px;"/></td>
				<td><input class="btn1" value="搜索" type="button" onclick="serch1();" /></td>
				<td></td>
				<!--  <td><input class="btn2" value="高级搜索" type="button" onclick="serch2();" /></td>-->
			</tr>
		</table>
		
		<div id="emp-grid"></div>
		
		<div id="emp-div" style="display: none;">
			<form id="form0" name="form0" style=" margin-right: 7px;">
				<table class="table-style">
					<tr>
						<th>员工编号</th><td style="width: 230px;" id="tbe_work_permit"></td>
					    <th>姓名</th><td style="width: 230px;" id="tbe_name"></td>
						<th>性别</th><td id="tbe_sex"></td>
					</tr>
					<tr>
						<th>身份证号</th><td id="tbe_idcard"></td>
					    <th>出生日期</th><td id="tbe_birthday"></td>
					    <th>民族</th><td id="tbe_nation"></td>
					</tr>
					<tr>
					    <th>籍贯</th><td id="tbe_native_palce"></td>
					    <th>家庭电话</th><td id="tbe_family_phone"></td>
						<th>家庭地址</th><td id="tbe_address"></td>
					</tr>
					<tr>
						<th>毕业学校</th><td id="tbe_graduate_college"></td>
					    <th>所学专业</th><td id="tbe_major"></td>
					    <th>学历</th><td id="tbe_qualification"></td>
					</tr>
				</table>
			</form>
			
			<div id="tab-div" style="margin-top:3px; margin-right: 7px;">
				<div title="单位信息">
					<form id="form1" name="form1">
						<table class="table-style">
							<tr>
								<th>单位名称</th><td style="width: 230px;" id="reserve1"></td>
							    <th>用工形式</th><td style="width: 230px;" id="tbe_employment_forms"></td>
							    <th>职级</th><td style="width: 230px;" id="tbe_position"></td>
							</tr>
							<tr>
								<th>员工状态</th><td id="tbe_status"></td>
							    <th>工作时间</th><td id="tbe_work_area"></td>
							    <th>入厂时间</th><td id="tbe_join_time"></td>
							</tr>
						</table>
					</form>
				</div>
				<div title="婚姻状态">
					<form id="form2" name="form2">
						<table class="table-style">
							<tr>
								<th>婚姻状态</th><td style="width: 230px;" id="tbe_marital_status"></td>
							    <th>结婚时间</th><td style="width: 230px;" id="tbe_married_time"></td>
								<th>结婚证号</th><td id="tbe_marriage_certificate"></td>
							</tr>
							<tr>
							    <th>是否晚婚</th><td id="tbe_is_late_marriage"></td>
							</tr>
						</table>
					</form>
				</div>
				<div title="配偶信息">
					<form id="form3" name="form3">
						<table class="table-style">
							<tr>
								<th>是否一汽员工</th><td style="width: 230px;" id="tbfi_spouse_is_join"></td>
							    <th>姓名</th><td style="width: 230px;" id="tbfi_spouse_name"></td>
							    <th>性别</th><td style="width: 230px;" id="tbfi_spouse_sex"></td>
							</tr>
							<tr>
							    <th>出生日期</th><td id="tbfi_spouse_birthday"></td>
							    <th>身份证号</th><td id="tbfi_spouse_idcard"></td>
							    <th></th><td></td>
							</tr>
							<tr>
								<th>单位</th><td id="tbfi_spouse_department"></td>
							    <th>职级</th><td id="tbfi_spouse_position"></td>
							    <th></th><td></td>
							</tr>
						</table>
					</form>
				</div>
				<div title="子女信息">
					<form id="form4" name="form4">
						<table class="table-style">
							<tr>
							    <th>家庭子女数</th><td style="width: 230px;" id="tbfi_children_num"></td>
							    <th>男孩数</th><td style="width: 230px;" id="tbfi_children_mnum"></td>
							    <th>女孩数</th><td style="width: 230px;" id="tbfi_children_fnum"></td>
							</tr>
						</table>
					</form>
				</div>
				<div title="生育情况">
					<form id="form5" name="form5">
						<table id="birth-table" class="table-style">
							<tr>
							    <th>类别</th>
							    <th>姓名（员工）</th>
							    <th>身份证号（员工）</th>
							    <th>工作单位（员工）</th>
							    <th>姓名（配偶）</th>
							    <th>身份证号（配偶）</th>
							    <th>工作单位（配偶）</th>
							    <th>结婚时间</th>
							    <th>结婚证号</th>
							    <th>生育指标批准起始时间</th>
							    <th>生育指标批准截止时间</th>
							</tr>
						</table>
						<br />
						<table id="onlyChild-table" class="table-style">
							<tr>
								<th>独生子女姓名</th>
								<th>独生子女性别</th>
								<th>独生子女年龄</th>
								<th>独生子女出生日期</th>
								<th>独生子女身份证号</th>
								<th>证件编号</th>
								<th>办证时间</th>
								<th>奖励发放时间</th>
								<th>费用核算参数</th>
							</tr>
						</table>
					</form>
				</div>
				<div title="奖罚情况">
					<form id="form6" name="form6">
						<table class="table-style">
							<tr>
							    <th>独生子女费</th><td id="onlyChildFee"></td>
							    <th>退休独生子女父母奖励费</th><td id="rewardFee"></td>
								<th>超生缴纳社会抚养费</th><td id="exceedsFee"></td>
							</tr>
						</table>
					</form>
				</div>
				<div title="孕产史">
					<form id="form7" name="form7">
						<table>
							<tr>
								<td>
									<table class="table-style">
										<tr>
											<th>晚婚+晚育</th>
											<td id="tbe_is_late_birth"></td>
										</tr>
									</table>
								</td>
							</tr>
							<tr>
								<td><br /></td>
							</tr>
							<tr>
								<td>
									<table id="pregnancy-table" class="table-style">
										<tr><th>怀孕登记状态</th><th>怀孕时间</th></tr>
									</table>
								</td>
								<td>&nbsp;&nbsp;</td>
								<td>
									<table id="neonate-table" class="table-style">
										<tr><th>计划状态登记项</th><th>出生时间</th></tr>
									</table>
								</td>
								<td>&nbsp;&nbsp;</td>
							</tr>
						</table>
					</form>
				</div>
				<div title="节育措施">
					<form id="form8" name="form8">
						<table>
							<tr>
								<td>
									<table class="table-style">
										<tr>
											<th>节育措施</th>
											<td id="tbe_birth_control_measures"></td>
										</tr>
									</table>
								</td>
							</tr>
							<tr>
								<td><br /></td>
							</tr>
							<tr>
								<td>
									<table id="contraception-table" class="table-style">
										<tr>
											<th>手术类型</th>
											<th>手术地点</th>
											<th>手术医院</th>
											<th>主治医生</th>
											<th>手术时间</th>
										</tr>
									</table>
								</td>
							</tr>
						</table>
					</form>
				</div>
				<div title="药具发放">
					<form id="form9" name="form9">
						<table id="contraceptive-table" class="table-style">
							<tr>
								<th>发放编号</th>
								<th>发放形式</th>
								<th>发放人</th>
								<th>发放时间</th>
								<th>药具数量</th>
								<th>药具种类</th>
								<th>药品名称</th>
								<th>药品规格</th>
								<th>剂型</th>
								<th>批号(药品编码)</th>
							</tr>
						</table>
					</form>
				</div>
				<div title="药具随访">
					<form id="form10" name="form10">
						<table id="yaojusuifang-table" class="table-style">
							<tr>
								<th>随访日期</th>
								
								<th>当前用药</th>
								<th>使用时间</th>
								<th>开始使用时间</th>
								
								<th>用药效果</th>
								<th>同时用药</th>
								<th>副反应（代码）</th>
								<th>情况处理</th>
								<th>登记者</th>
							</tr>
						</table>
					</form>
				</div>
				<div title="重点随访">
					<form id="form11" name="form11">
						<table id="keySerObj-table" class="table-style">
							<tr>
								<th>随访时间</th>
								<th>随访人</th>
								<th>随访内容</th>
							</tr>
						</table>
					</form>
				</div>
			</div>
		</div>
		
		
		<!-- 将用到的两个常用逻辑运算符初始化在页面中便于上面的使用  -->
		<div style="display: none;" id="condition">
			<select name="luojiOne">
				<option value="=">等于</option>
				<option value="<>">不等于</option>
				<option value=">">大于</option>
				<option value="<"">小于</option>
				<option value="is null">为NULL</option>
				<option value="like">包含</option>
				<option value="in">在...之中(1,2,3)</option>
				<option value="between">在...之间(1,2)</option>
			</select>
		</div>
		<div style="display: none;" id="conditionAnd">
			<select name="luojiTwo">
				<option value="and">与</option>
				<option value="or">或</option>
			</select>
		</div>
		<div id="tallSearch" style="display: none;">
			<table width="99%">
				<tr>
				    <td width="15%">大类</td>
					<td width="15%">详细列表</td>
					<td width="70%" style="text-algin: center;">
						<table width="100%">
							<tr>
								<td width="60px">字段名称</td>
								<td width="130px">条件匹配</td>
								<td width="150px">字段赋值</td>
								<td width="90px">条件关系</td>
								<td width="60px">移除操作</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
				<td width="15%" style="vertical-align: top;">
				   <select id="sel" style="height: 356px; width: 120px;" ondblclick="tallSearch_first(this.value);" multiple="multiple">
							<option value="org">组织机构</option>
							<option value="renkou">人口信息</option>
							<option value="jisheng">计生相关</option>
							<option value="sishu">四术相关</option>
							<option value="yaoju">药具相关</option>							
					</select>
				</td>
					<!-- select中给定的字段为数据库中字段，此处给出表明，是为了后台有多表查询时使用，但是此查询并不适合嵌套查询（子查询） 后台有统一替换过程  -->
					<td width="15%" style="vertical-align: top;">
						<table width="100%" id="second_table">
						</table>
					</td>
					<td width="70%" style="text-algin: center;" valign="top">
						<table width="100%" id="appendTable">
						</table>
					</td>
				</tr>
			</table>
		</div>
		
		
	</body>
</html>










